//
//  ViewController.swift
//  cmd2
//
//  Created by 郭颢源 on 2021/4/1.
//

import UIKit
extension API {
    static let getBookDetail = API(path: "/v2/book/1220562")
}
class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
//        https://www.56114.net/mFinance/loginByOpenid
        let params = ["mobile":"1234567","password":"000000"]
        
        NetworkManager("https://www.56114.net/mTransfer/Login").get(path: "", params: params) { (res) in
            let data = try! res.get()
            print(String(data: data, encoding: .utf8)!)
        }
        
        NetworkManager.shared.baseUrl = "https://api.douban.com"
        BookResponse.request(api: .getBookDetail, params: nil) { (res) in
            guard res.isSuccess else { return }
            print(res.value!.toJSON()!)
        }
    }


}

